﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using WikiCsharpCommon.Settings;

namespace WikiCsharpCommon
{
    public class MyBugtracker : Common.Bugtracker
    {
        public MySettingsManager Settings
        {
            get { return settings_ as MySettingsManager; }
        }

        private WikiCsharpBugtracker m_wcbt = new WikiCsharpBugtracker();

        public MyBugtracker(MySettingsManager settings)
            : base(settings) { }

        protected override void SetSteps()
        {
            validation_steps_texts_ = new string[] { "Validating Folder Structure", "Validating Username" };
        }

        protected override bool RunCurrentStep(int current_step)
        {
            if (current_step == 0)
            {
                if (!m_wcbt.ValidateBugTrackerFolder(Settings.Folder))
                    return false;
            }
            else if (current_step == 1)
            {
                if (m_wcbt.GetUserFullName(Settings.Folder, Environment.UserName) == Environment.UserName)
                    return false;
            }

            return true;
        }
    }
}
